package com.site.controller;

import com.site.common.R;
import com.site.common.annotation.RedissonLock;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LockController extends BaseController {

    /**
     * 分布式锁测试
     * 访问：http://localhost:8080/bale/lock?lockName=test
     * @return
     */
    @RedissonLock(key = "#lockName")
    @RequestMapping("/lock")
    public R<String> testLock(String lockName){
        return R.ok(lockName);
    }
}
